/**
 * Created by zxr on 16/11/12.
 */
var connect = require('connect');
var app = connect();
setFun = function(obj){
	var method = obj.method;
	var url = obj.url;
	return function logger(req,res,next){
		console.log(method + '------' + url);
		next();
	}
};
app.use(setFun({method:'get',url:'./index'}));
app.use('/index',holle);
app.listen('4000');
//中间件

function holle(req,res){
	res.setHeader('Content-Type','text/html');
	res.end('<h1>我是输出中间件</h1>')
}